package Model
{
	public class ShadingFromBalconies extends ComplexShading
	{
		public function ShadingFromBalconies(direction:String)
		{
			super(direction);
		}
		
		public override function calculateShadingFactor():void
		{
			calculateAlpha();
			
			if(this._alpha <= 15)
			{
				this._x1 = 0;
				this._y1 = 1;
				this._x2  = 10;
				this._y2 = 0.95;
			}
			else if(this._alpha <= 30 && this._alpha > 15)
			{
				this._x1 = 10;
				this._y1 = 0.95;
				this._x2  = 20;
				this._y2 = 0.91;
			}
			else if(this._alpha <= 45 && this._alpha > 30)
			{
				this._x1 = 20;
				this._y1 = 0.91;
				this._x2  = 30;
				this._y2 = 0.75;
			}
			else if( this._alpha <= 60 && this._alpha > 45)
			{
				this._x1 = 30;
				this._y1 = 0.75;
				this._x2  = 40;
				this._y2 = 0.52;
			}
			else if(this._alpha < 75 && this._alpha > 60)
			{
				this._x1 = 40;
				this._y1 = 0.52;
				this._x2  = 50;
				this._y2 = 0.32;
			}
			
			this.shadingFactor=(this._correctionFactor * (((this._y2 - this._y1)/(this._x2 - this._y2))*(this._alpha -this._x1) + this._y1));
		}
	}
}